<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>

    :root {
      --color: green;
    }

    .box {
      --color: pink;
      --white: #fff;
    }

    span {
      color: var(--color)
    }

    .test {
      background: var(--color);
      height: 100px;
      width: 100px;
      --width: "200";
    }

    .test::before {
      content: var(--width)"px"
    }

    @media screen and (min-width: 800px) {
      .test {
        --width: "大于800"
      }
    }

  </style>
</head>
<body>
  <div class="box">
    <span>box</span>
    <p>green</p>
  </div>
  <div class="test"></div>
</body>
</html>